[mirrors]
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.29.tar.gz

[vars]
filesize=294417
sha512=c169e29d53353e3d65913a5a5ba219752218968b0c036d4bfb25e7f3a9e31fe1e6adfcdbb410116e9c161c99aa3a7314fdc889ba36ba63f002d11ff9dba6974d

[deps]

[build]
patch -p1 < "$K"/wireless-tools-Makefile.patch
patch -p1 < "$K"/wireless-tools-headers.patch
# package causes gcc breakage when lto is used
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61487
if [ x"$A" = xmips ] ; then
  optldflags=$(printf "%s" "$optldflags"|sed 's/-flto//g')
  optcflags=$(printf "%s" "$optcflags"|sed 's/-flto//g')
fi
sed -i 's@sbin@bin@' Makefile
make CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE $optcflags" \
     LDFLAGS="$optldflags -static" PREFIX="$butch_prefix" -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
mv "$dest"/bin/iwlist "$dest"/bin/iwlist-verbose
printf '#/bin/sh\niwlist-verbose "$@"|sed "/IE: Unknown/d"\n' > \
     "$dest"/bin/iwlist
chmod +x "$dest"/bin/iwlist
